<?php

	require_once "model/Database.php";
	require_once "model/DBConfig.php";
	require_once "model/LoginHandler.php";
	require_once "model/RegisterHandler.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
    	<title>Tester</title>
   		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
  	</head>
  	<body class="">
	  <p>
	  	
	  	<?php 
			echo "<h1>Enhetstester</h1>";
	
			echo "<h2>LoginHandler</h2>";
			
			$db = new Database();
			$config = new DBConfig();
			$db->Connect($config);
			$handler = new LoginHandler($db);
			if ($handler->Test() == true) {
				echo "<p>LoginHandler-test ok.</p>";
			} 
			else {
				echo "<p>LoginHandler-test fungerar ej.</p>";
			}	
			
			echo "<h2>Database</h2>";
			
			$dbConf = new DBConfig();
			$db = new Database();
			if ($db->Test($dbConf) == true) {
				echo "<p>Databas-test ok.</p>";
			}
			else {
				echo "<p>Databas-test fungerar ej.</p>";
			}
			
			echo "<h2>RegisterHandler</h2>";
			
			$regHandler = new RegisterHandler($db);
			if ($regHandler->Test() == true) {
				echo "<p>RegisterHandler-test ok.</p>";
			} 
			else {
				echo "<p>RegisterHandler-test fungerar ej.</p>";
			}
		?>
	  </p>
  </body>
</html>